<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":true,"scrollpercent":true},
    copycode: {"enable":true,"show_result":true,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: 'search.xml'
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="csharp之ATM将会分为三篇写，有登录篇，找回密码篇，功能篇。如果写完第一篇有报错，那就写第三篇，因为那么代码相关联，很遗憾，因此又写了一篇ATM之三层架构篇。很惭愧。">
<meta name="keywords" content="源码,c#ATm">
<meta property="og:type" content="article">
<meta property="og:title" content="csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇">
<meta property="og:url" content="http://yoursite.com/2019/c/csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇/index.html">
<meta property="og:site_name" content="Evian Z">
<meta property="og:description" content="csharp之ATM将会分为三篇写，有登录篇，找回密码篇，功能篇。如果写完第一篇有报错，那就写第三篇，因为那么代码相关联，很遗憾，因此又写了一篇ATM之三层架构篇。很惭愧。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20181127154254979.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0lfVGVuS2Fp,size_16,color_FFFFFF,t_70">
<meta property="og:updated_time" content="2019-11-16T02:42:37.217Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇">
<meta name="twitter:description" content="csharp之ATM将会分为三篇写，有登录篇，找回密码篇，功能篇。如果写完第一篇有报错，那就写第三篇，因为那么代码相关联，很遗憾，因此又写了一篇ATM之三层架构篇。很惭愧。">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20181127154254979.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0lfVGVuS2Fp,size_16,color_FFFFFF,t_70">



  <link rel="alternate" href="/atom.xml" title="Evian Z" type="application/atom+xml">



  
  
  <link rel="canonical" href="http://yoursite.com/2019/c/csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇 | Evian Z</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
<a href="https://github.com/Hzrj" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Evian Z</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <h1 class="site-subtitle" itemprop="description">别浪费时间，致自己</h1>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    
      
    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    
      
    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    
      
    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签<span class="badge">28</span></a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    
      
    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类<span class="badge">8</span></a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    
      
    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档<span class="badge">19</span></a>

  </li>

      
      
        <li class="menu-item menu-item-search">
          <a href="javascript:;" class="popup-trigger">
          
            <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/c/csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Evian Z">
      <meta itemprop="description" content="Evian 交流群 799983232">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Evian Z">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">csharpATM之功能篇（存钱，取钱，转账，交易明细）完结篇

              
            
          </h2>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-29 21:56:44" itemprop="dateCreated datePublished" datetime="2019-07-29T21:56:44+08:00">2019-07-29</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-11-16 10:42:37" itemprop="dateModified" datetime="2019-11-16T10:42:37+08:00">2019-11-16</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/c/" itemprop="url" rel="index"><span itemprop="name">c#</span></a></span>

                
                
              
            </span>
          

          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
                 热度： 
                <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>
              </span>
            </span>
          

          

          
          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
              
                <span class="post-meta-item-text">本文字数：</span>
              
              <span title="本文字数">16k</span>
            </span>
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
              
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              
              <span title="阅读时长">20 分钟</span>
            </span>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <br> c#ATM之功能篇（存钱，取钱，转账，交易明细）完结篇带详细注释。一共七个功能，不难，代码还有优化空间，之后再发一篇ATM之优化篇。<p></p>
<p><img src="https://img-blog.csdnimg.cn/20181127154254979.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0lfVGVuS2Fp,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>首先先添加一条命名空间</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">using System.Data.SqlClient;</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">public Form3()</span><br><span class="line">        &#123;</span><br><span class="line">            InitializeComponent();</span><br><span class="line"></span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        public Form3(string str)//构造一个函数用来接收来自Form1的卡号</span><br><span class="line">        &#123;</span><br><span class="line">            InitializeComponent();</span><br><span class="line">            textBox1.Text = str;</span><br><span class="line">            //MessageBox.Show(str);打印从form1传来的参数 验证是不是登录时的卡号</span><br><span class="line">        &#125;</span><br></pre></td></tr></table></figure>

<p> 1， button1查询余额的功能</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">private void button1_Click(object sender, EventArgs e)</span><br><span class="line">       &#123;   </span><br><span class="line">           //连接数据库字符串</span><br><span class="line">           string count = &quot;SERVER=.;DATABASE=OX;USER=SA;PWD=1;Integrated Security=True;&quot;;</span><br><span class="line">           //执行sql语句</span><br><span class="line">           string sql = &quot;select * from DATA where ID=&apos;&quot; + textBox1.Text.Trim() + &quot;&apos;&quot;;</span><br><span class="line">           SqlConnection con = new SqlConnection(count);</span><br><span class="line">           con.Open();</span><br><span class="line">           //创建操作对象cmd</span><br><span class="line">           SqlCommand cmd = new SqlCommand(sql, con);</span><br><span class="line">           SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">           if (dr.HasRows)</span><br><span class="line">           &#123;</span><br><span class="line">               dr.Read();</span><br><span class="line">               //读取余额填充到textBox2.Text中</span><br><span class="line">               textBox2.Text = dr[&quot;MORY&quot;].ToString().Trim();</span><br><span class="line">               //有打开就要有关闭哦</span><br><span class="line">               dr.Close();</span><br><span class="line">               con.Close();</span><br><span class="line">           &#125;</span><br></pre></td></tr></table></figure>

<p> 2， button2取钱功能</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br></pre></td><td class="code"><pre><span class="line">//取钱的功能：→要判断自己有多少钱，能取的钱不能大于自己的本金，钱不能取负数</span><br><span class="line">private void button2_Click(object sender, EventArgs e)</span><br><span class="line">        &#123;</span><br><span class="line">      	    //先判断textBox2.Text等不等于空，不等于空就执行else里面的语块句</span><br><span class="line">            if (textBox2.Text==&quot;&quot;)</span><br><span class="line">            &#123;</span><br><span class="line">                MessageBox.Show(&quot;请输入金额&quot;);</span><br><span class="line">            &#125;</span><br><span class="line">            else</span><br><span class="line">            &#123;</span><br><span class="line">                string count = &quot;SERVER=.;DATABASE=OX;USER=SA;PWD=1;Integrated Security=True;&quot;;</span><br><span class="line">                string sql01 = &quot;select * from DATA where ID=&apos;&quot; + textBox1.Text.Trim() + &quot;&apos;&quot;;</span><br><span class="line">                SqlConnection con01 = new SqlConnection(count);</span><br><span class="line">                con01.Open();</span><br><span class="line">                SqlCommand cmd01 = new SqlCommand(sql01, con01);</span><br><span class="line">                SqlDataReader dr01 = cmd01.ExecuteReader();</span><br><span class="line">                dr01.Read();</span><br><span class="line">                //Convert.表示强制转换的意思 ToInt32表示类型 类型可以换</span><br><span class="line">                int i = Convert.ToInt32(dr01[&quot;mory&quot;].ToString().Trim());</span><br><span class="line">                //将string类型的文本框强制转换成int类型，思考一下，不用这类强制转换，还有哪些方法可以强制转换</span><br><span class="line">                int j = Convert.ToInt32(textBox2.Text);</span><br><span class="line">                int k = i - j;</span><br><span class="line">                int txt = Convert.ToInt32(textBox2.Text);</span><br><span class="line">                dr01.Close();</span><br><span class="line">                if (txt &gt; i | txt &lt; 0)</span><br><span class="line">                &#123;</span><br><span class="line">                    MessageBox.Show(&quot;取出来的钱不能大于本金或为负数&quot;, &quot;温馨提示&quot;);</span><br><span class="line">                &#125;</span><br><span class="line">                else</span><br><span class="line">                &#123;</span><br><span class="line">                    //原来的本金减去要取出来的金额</span><br><span class="line">                    //先读取原来的本金为i,再获得取款の为j  即i-j=k 输入数据库 ，</span><br><span class="line">                    string NOW = &quot;&quot;;//先申明一个空变量来接收时间信息</span><br><span class="line">                    string count01 = &quot;server=.;database=ox;user=sa;pwd=1;Integrated Security=True;&quot;;</span><br><span class="line">                    string sql = &quot;select * from DATA&quot;;</span><br><span class="line">                    SqlConnection con = new SqlConnection(count);</span><br><span class="line">                    con.Open();</span><br><span class="line">                    SqlCommand cmd = new SqlCommand(sql, con);</span><br><span class="line">                    SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">                    if (dr.HasRows)</span><br><span class="line">                    &#123;</span><br><span class="line">                        dr.Read();</span><br><span class="line">                        /*-----------先读取之前转账的信息------------*/</span><br><span class="line">                        NOW = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line">                        dr.Close(); con.Close();</span><br><span class="line">                    &#125;</span><br><span class="line">                    /*------插入储存信息格式------*/</span><br><span class="line">                    NOW += DateTime.Now.Year + &quot;/&quot; + DateTime.Now.Month + &quot;/&quot; + DateTime.Now.Day + &quot;/&quot; + DateTime.Now.Hour + &quot;/&quot; + DateTime.Now.Minute + &quot;/&quot; + DateTime.Now.Second;</span><br><span class="line">                    NOW += &quot;我方卡号：&quot; + textBox1.Text;</span><br><span class="line">                    NOW += &quot; 金额：&quot; + textBox2.Text + &quot;元 &quot; + &quot;已取出&quot;;</span><br><span class="line"></span><br><span class="line">                    string sql02 = &quot;update DATA set mory=&apos;&quot; + k + &quot;&apos;,RECORD=&apos;&quot; + NOW + &quot;&apos;where ID=&apos;&quot; + textBox1.Text.Trim() + &quot;&apos;&quot;;</span><br><span class="line">                    SqlConnection con02 = new SqlConnection(count01);</span><br><span class="line">                    con02.Open();</span><br><span class="line">                    SqlCommand cmd02 = new SqlCommand(sql02, con02);</span><br><span class="line">                    SqlDataReader dr02 = cmd02.ExecuteReader();</span><br><span class="line">                    dr02.Read();</span><br><span class="line">                    MessageBox.Show(&quot;取款成功&quot;);</span><br><span class="line">                    dr02.Close();</span><br><span class="line">                    con02.Close();</span><br><span class="line"></span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br></pre></td></tr></table></figure>

<p> 3， textBox2_KeyPress屏蔽要字母，有这段代码就是文本框里面不能输入字母和符号</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">private void textBox2_KeyPress(object sender, KeyPressEventArgs e)</span><br><span class="line">       &#123;</span><br><span class="line">           if (e.KeyChar &gt; 0x20)</span><br><span class="line">           &#123;</span><br><span class="line">               try</span><br><span class="line">               &#123;</span><br><span class="line">                   double.Parse(((TextBox)sender).Text + e.KeyChar.ToString());</span><br><span class="line">               &#125;</span><br><span class="line">               catch</span><br><span class="line">               &#123;</span><br><span class="line">                   e.KeyChar = (char)0;   //处理非法字符  </span><br><span class="line">               &#125;</span><br><span class="line">           &#125;  </span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>

<p> 4， textBox3_KeyPress屏蔽要字母，有这段代码就是文本框里面不能输入字母和符号</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">private void textBox3_KeyPress(object sender, KeyPressEventArgs e)</span><br><span class="line">       &#123;</span><br><span class="line">           if (e.KeyChar &gt; 0x20)</span><br><span class="line">           &#123;</span><br><span class="line">               try</span><br><span class="line">               &#123;</span><br><span class="line">                   double.Parse(((TextBox)sender).Text + e.KeyChar.ToString());</span><br><span class="line">               &#125;</span><br><span class="line">               catch</span><br><span class="line">               &#123;</span><br><span class="line">                   e.KeyChar = (char)0;   //处理非法字符  </span><br><span class="line">               &#125;</span><br><span class="line">           &#125;  </span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>

<p>5， textBox4_KeyPress屏蔽要字母，有这段代码就是文本框里面不能输入字母和符号</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">private void textBox4_KeyPress(object sender, KeyPressEventArgs e)</span><br><span class="line">       &#123;</span><br><span class="line">           if (e.KeyChar &gt; 0x20)</span><br><span class="line">           &#123;</span><br><span class="line">               try</span><br><span class="line">               &#123;</span><br><span class="line">                   double.Parse(((TextBox)sender).Text + e.KeyChar.ToString());</span><br><span class="line">               &#125;</span><br><span class="line">               catch</span><br><span class="line">               &#123;</span><br><span class="line">                   e.KeyChar = (char)0;   //处理非法字符  </span><br><span class="line">               &#125;</span><br><span class="line">           &#125;  </span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>

<p> 6， button3存钱功能</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br></pre></td><td class="code"><pre><span class="line">private void button3_Click(object sender, EventArgs e)</span><br><span class="line">        &#123;</span><br><span class="line">            int txt = Convert.ToInt32(textBox2.Text);</span><br><span class="line">            if (txt &lt; 0)</span><br><span class="line">            &#123;</span><br><span class="line">                MessageBox.Show(&quot;不能存小于0的金额&quot;);</span><br><span class="line">            &#125;</span><br><span class="line">            else</span><br><span class="line">            &#123;</span><br><span class="line">                string NOW=&quot;&quot;;</span><br><span class="line">                string count = &quot;server=.;database=ox;user=sa;pwd=1;Integrated Security=True;&quot;;</span><br><span class="line">                string sql = &quot;select * from DATA&quot;;</span><br><span class="line">                SqlConnection con = new SqlConnection(count);</span><br><span class="line">                con.Open();</span><br><span class="line">                SqlCommand cmd = new SqlCommand(sql, con);</span><br><span class="line">                SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">                if (dr.HasRows)</span><br><span class="line">                &#123;</span><br><span class="line">                    dr.Read();</span><br><span class="line">                    /*-----------先读取之前转账的信息------------*/</span><br><span class="line">                    NOW = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line">                    //NOW1 = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line"></span><br><span class="line">                &#125;</span><br><span class="line">                dr.Close();</span><br><span class="line">                con.Close();</span><br><span class="line">                /*------插入储存信息格式------*/</span><br><span class="line">                NOW += DateTime.Now.Year + &quot;/&quot; + DateTime.Now.Month + &quot;/&quot; + DateTime.Now.Day + &quot;/&quot; + DateTime.Now.Hour + &quot;/&quot; + DateTime.Now.Minute + &quot;/&quot; + DateTime.Now.Second;</span><br><span class="line">                NOW += &quot;我方卡号：&quot; + textBox1.Text;</span><br><span class="line">                NOW += &quot; 金额：&quot; + textBox2.Text + &quot;元 &quot; + &quot;已存入&quot;;</span><br><span class="line"></span><br><span class="line">                /*-----------先判断自己有多少本金再加上要存储的金额------等这些计算好了在存进数据中-------*/</span><br><span class="line">                string count01 = &quot;SERVER=.;DATABASE=OX;USER=SA;PWD=1;Integrated Security=True;&quot;;</span><br><span class="line">                string sql01 = &quot;select * from DATA where ID=&apos;&quot; + textBox1.Text.Trim() + &quot;&apos;&quot;;</span><br><span class="line">                SqlConnection con01 = new SqlConnection(count01);</span><br><span class="line">                con01.Open();</span><br><span class="line">                SqlCommand cmd01 = new SqlCommand(sql01, con01);</span><br><span class="line">                SqlDataReader dr01 = cmd01.ExecuteReader();</span><br><span class="line">                dr01.Read();</span><br><span class="line">                int i = Convert.ToInt32(dr01[&quot;mory&quot;].ToString().Trim());//读取自己的账户有多少钱</span><br><span class="line">                int j = Convert.ToInt32(textBox2.Text);//接受要储存的金额</span><br><span class="line">                int k = i + j;//本金加要储存的金额</span><br><span class="line">                dr01.Close();</span><br><span class="line">                con01.Close();</span><br><span class="line">                /*------------------------*/</span><br><span class="line">                string sql02 = &quot;update DATA set mory=&apos;&quot; + k + &quot;&apos;,RECORD=&apos;&quot;+NOW+&quot;&apos;where ID=&apos;&quot; + textBox1.Text.Trim() + &quot;&apos;&quot;;</span><br><span class="line">                SqlConnection con02 = new SqlConnection(count);</span><br><span class="line">                con02.Open();</span><br><span class="line">                SqlCommand cmd02 = new SqlCommand(sql02, con02);</span><br><span class="line">                if (cmd02.ExecuteNonQuery() &gt; 0)</span><br><span class="line">                &#123;</span><br><span class="line">                    MessageBox.Show(&quot;储存成功&quot;);</span><br><span class="line">                &#125;</span><br><span class="line">                else</span><br><span class="line">                &#123;</span><br><span class="line">                    MessageBox.Show(&quot;Test&quot;);</span><br><span class="line">                &#125;</span><br><span class="line">                con02.Close();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br></pre></td></tr></table></figure>

<p> 7.，button4转账功能</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br></pre></td><td class="code"><pre><span class="line">private void button4_Click(object sender, EventArgs e)</span><br><span class="line">       &#123;</span><br><span class="line">           if (textBox4.Text==&quot;&quot;&amp;textBox3.Text==&quot;&quot;)</span><br><span class="line">           &#123;</span><br><span class="line">               MessageBox.Show(&quot;请输入转账信息&quot;);</span><br><span class="line">           &#125;</span><br><span class="line">           else</span><br><span class="line">           &#123;</span><br><span class="line">               textBox3.Visible = true;</span><br><span class="line">               label3.Visible = true;</span><br><span class="line">               textBox4.Visible = true;</span><br><span class="line">               label4.Visible = true;</span><br><span class="line">               int i2, text2, text4;</span><br><span class="line">               if (true)</span><br><span class="line">               &#123;</span><br><span class="line">                   string count = &quot;SERVER=.;USER=SA;PWD=1;DATABASE=OX;Integrated Security=True;&quot;;</span><br><span class="line">                   string sql = &quot;select * from DATA where ID=&apos;&quot; + textBox1.Text + &quot;&apos;&quot;;</span><br><span class="line">                   SqlConnection cno = new SqlConnection(count);</span><br><span class="line">                   SqlCommand cmd = new SqlCommand(sql, cno);</span><br><span class="line">                   cno.Open();</span><br><span class="line">                   SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">                   dr.Read();</span><br><span class="line">                   //I1-TXT=自己账号的本金更新数据   txt+i2=对方的本金 更新数据</span><br><span class="line">                   int i1 = Convert.ToInt32(dr[&quot;mory&quot;].ToString().Trim());//获取自己的本金</span><br><span class="line">                   i2 = i1;</span><br><span class="line">                   dr.Close();</span><br><span class="line">                   cno.Close();</span><br><span class="line">                   //text4 = textBox4.Text;</span><br><span class="line">                   int txt4 = Convert.ToInt32(textBox4.Text);//要转账的金额</span><br><span class="line">                   int txt2 = Convert.ToInt32(textBox2.Text);</span><br><span class="line">                   text2 = txt2;</span><br><span class="line">                   text4 = txt4;</span><br><span class="line">               &#125;</span><br><span class="line">               if (/*text2 &gt; i2 | text2 &lt; 0 |*/ text4 &gt; i2 | text4 &lt; 0)</span><br><span class="line">               &#123;</span><br><span class="line">                   MessageBox.Show(&quot;取出来的钱不能大于本金或为负数&quot;, &quot;温馨提示&quot;);</span><br><span class="line">               &#125;</span><br><span class="line">               else</span><br><span class="line">               &#123;</span><br><span class="line">                   string NOW = &quot;&quot;;</span><br><span class="line">                   string NOW1 = &quot;&quot;;</span><br><span class="line">                   //MessageBox.Show(NOW);</span><br><span class="line">                   string count = &quot;server=.;database=ox;user=sa;pwd=1;Integrated Security=True;&quot;;</span><br><span class="line">                   string sql = &quot;select * from DATA&quot;;</span><br><span class="line">                   SqlConnection con = new SqlConnection(count);</span><br><span class="line">                   con.Open();</span><br><span class="line">                   SqlCommand cmd = new SqlCommand(sql, con);</span><br><span class="line">                   SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">                   if (dr.HasRows)</span><br><span class="line">                   &#123;</span><br><span class="line">                       dr.Read();</span><br><span class="line">                       /*-----------先读取之前转账的信息------------*/</span><br><span class="line">                       NOW = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line">                       NOW1 = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line"></span><br><span class="line">                   &#125;</span><br><span class="line">                   dr.Close();</span><br><span class="line">                   con.Close();</span><br><span class="line">                   //----------储存转账信息------------</span><br><span class="line">                   NOW += DateTime.Now.Year + &quot;/&quot; + DateTime.Now.Month + &quot;/&quot; + DateTime.Now.Day + &quot;/&quot; + DateTime.Now.Hour + &quot;/&quot; + DateTime.Now.Minute + &quot;/&quot; + DateTime.Now.Second;</span><br><span class="line">                   NOW += &quot;对方卡号：&quot; + textBox3.Text;</span><br><span class="line">                   NOW += &quot;金额：&quot; + text4 + &quot;元 &quot; + &quot;已转入&quot;;</span><br><span class="line">                   /*-----------先判断要存进多少钱，然后自己的账户减多少钱和对方账户加多少钱------等这些计算好了在存进数据中-------*/</span><br><span class="line">                   string count01 = &quot;SERVER=.;USER=SA;PWD=1;DATABASE=OX;Integrated Security=True;&quot;;</span><br><span class="line">                   string sql01 = &quot;select * from DATA where ID=&apos;&quot; + textBox3.Text + &quot;&apos;&quot;;</span><br><span class="line">                   SqlConnection cno01 = new SqlConnection(count01);</span><br><span class="line">                   cno01.Open();</span><br><span class="line">                   SqlCommand cmd01 = new SqlCommand(sql01, cno01);</span><br><span class="line">                   SqlDataReader dr01 = cmd01.ExecuteReader();</span><br><span class="line">                   dr01.Read();</span><br><span class="line">                   int i3 = Convert.ToInt32(dr01[&quot;mory&quot;].ToString().Trim());//获取对方账号的本金</span><br><span class="line">                   dr01.Close();</span><br><span class="line">                   cno01.Close();</span><br><span class="line"></span><br><span class="line">                   int j = i2 - text4;//减去转账的金额等于剩下自己的本金</span><br><span class="line">                   string count02 = &quot;SERVER=.;USER=SA;PWD=1;DATABASE=OX;Integrated Security=True;&quot;;</span><br><span class="line">                   string sql02 = &quot;update DATA set mory=&apos;&quot; + j + &quot;&apos; ,RECORD=&apos;&quot; + NOW + &quot;&apos; where ID=&apos;&quot; + textBox1.Text + &quot;&apos;&quot;;</span><br><span class="line">                   //string sql = &quot;select count(*) from yonghu where yname=&apos;&quot; + textBox4.Text + &quot;&apos; and ypwd=&apos;&quot; + textBox5.Text + &quot;&apos;&quot;;</span><br><span class="line">                   //插入信息</span><br><span class="line">                   SqlConnection cno02 = new SqlConnection(count02);</span><br><span class="line">                   cno02.Open();</span><br><span class="line">                   SqlCommand cmd02 = new SqlCommand(sql02, cno02);</span><br><span class="line">                   int n = cmd02.ExecuteNonQuery();</span><br><span class="line">                   dr01.Close();</span><br><span class="line"></span><br><span class="line">                   NOW1 = DateTime.Now.Year + &quot;/&quot; + DateTime.Now.Month + &quot;/&quot; + DateTime.Now.Day + &quot;/&quot; + DateTime.Now.Hour + &quot;/&quot; + DateTime.Now.Minute + &quot;/&quot; + DateTime.Now.Second;</span><br><span class="line">                   NOW1 += &quot;对方卡号：&quot; + textBox3.Text;</span><br><span class="line">                   NOW1 += &quot;金额：&quot; + text4 + &quot;元 &quot; + &quot;已转出&quot;;</span><br><span class="line">                   int k = i3 + text4;//加上转账过来的金额等于自己的本金</span><br><span class="line">                   string count03 = &quot;SERVER=.;USER=SA;PWD=1;DATABASE=OX;&quot;;</span><br><span class="line">                   string sql03 = &quot;update DATA set mory=&apos;&quot; + k + &quot;&apos;, RECORD=&apos;&quot; + NOW1 + &quot;&apos; where ID=&apos;&quot; + textBox3.Text + &quot;&apos;&quot;;</span><br><span class="line">                   SqlConnection cno03 = new SqlConnection(count03);</span><br><span class="line">                   cno03.Open();</span><br><span class="line">                   SqlCommand cmd03 = new SqlCommand(sql03, cno03);</span><br><span class="line">                   if (cmd03.ExecuteNonQuery() &gt; 0)</span><br><span class="line">                   &#123;</span><br><span class="line">                       MessageBox.Show(&quot;转账成功&quot;);</span><br><span class="line">                   &#125;</span><br><span class="line">                   else</span><br><span class="line">                   &#123;</span><br><span class="line">                       MessageBox.Show(&quot;Test&quot;);</span><br><span class="line">                   &#125;</span><br><span class="line">               &#125;</span><br><span class="line">           &#125;</span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>

<p>8， button5交易明细</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">private void button5_Click(object sender, EventArgs e)</span><br><span class="line">        &#123;</span><br><span class="line">            textBox3.Visible = true;</span><br><span class="line">            label3.Visible = true;</span><br><span class="line">            textBox4.Visible = true;</span><br><span class="line">            label4.Visible = true;</span><br><span class="line">            textBox5.Visible = true;</span><br><span class="line">             //MessageBox.Show(NOW);</span><br><span class="line">            string count = &quot;server=.;database=ox;user=sa;pwd=1;Integrated Security=True;&quot;;</span><br><span class="line">            string sql = &quot;select * from DATA&quot;;</span><br><span class="line">            SqlConnection con = new SqlConnection(count);</span><br><span class="line">            con.Open();</span><br><span class="line">            SqlCommand cmd = new SqlCommand(sql,con);</span><br><span class="line">            SqlDataReader dr = cmd.ExecuteReader();</span><br><span class="line">            if (dr.HasRows)</span><br><span class="line">            &#123;</span><br><span class="line">                dr.Read();</span><br><span class="line">                textBox5.Text = dr[&quot;RECORD&quot;].ToString().Trim();</span><br><span class="line">                dr.Close();</span><br><span class="line">            &#125;</span><br><span class="line">            con.Close();</span><br><span class="line">        &#125;</span><br></pre></td></tr></table></figure>

<p> 9， button6返回登录界面</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">private void button6_Click(object sender, EventArgs e)</span><br><span class="line">       &#123;</span><br><span class="line">           this.Close();</span><br><span class="line">           Form1 f1 = new Form1();</span><br><span class="line">           f1.Show();</span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>

<p><a href="http://3411.top/2019/07/29/csharp_ATM之登录篇" target="_blank" rel="noopener">csharp_ATM之登录篇</a></p>
<p> <a href="http://3411.top/2019/07/29/csharp_ATM%E4%B9%8B%E6%89%BE%E5%9B%9E%E5%AF%86%E7%A0%81%E7%AF%87/" target="_blank" rel="noopener">charp_ATM之找回密码篇</a></p>
      
    </div>

    

    
      
    

    
    
    

    
      <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center;">
  <img id="wechat_subscriber_qcode" src="/uploads/wechat-qcode.jpg" alt="Evian Z wechat" style="width: 200px; max-width: 100%;">
  <div></div>
</div>

    

    
      
    
    
      <div>
        <div id="reward-container">
  <div>打赏由马云爸爸买单，谢谢请我喝牛奶.</div>
  <button id="reward-button" disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">

    
      
      
        
      
      <div style="display: inline-block">
        <img src="/images/Alipay red envelope.jpg" alt="Evian Z 支付宝红包">
        <p>支付宝红包</p>
      </div>
    
      
      
        
      
      <div style="display: inline-block">
        <img src="/images/alipay.jpg" alt="Evian Z 支付宝">
        <p>支付宝</p>
      </div>
    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/源码/" rel="tag"># 源码</a>
          
            <a href="/tags/c-ATm/" rel="tag"># c#ATm</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/c/csharp_ATM之找回密码篇/" rel="next" title="csharp_ATM之找回密码篇">
                <i class="fa fa-chevron-left"></i> csharp_ATM之找回密码篇
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/java/java-抽象类的实现与具体解析-抽象类与接口系列之一/" rel="prev" title="java  抽象类的实现与具体解析 抽象类与接口系列之一">
                java  抽象类的实现与具体解析 抽象类与接口系列之一 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
    <div>  
      
          
        
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <div class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
    <img class="site-author-image" itemprop="image" src="/images/avatar.jpg" alt="Evian Z">
  
  <p class="site-author-name" itemprop="name">Evian Z</p>
  <div class="site-description motion-element" itemprop="description">Evian 交流群 799983232</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">19</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">20</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>



  <div class="feed-link motion-element">
    <a href="/atom.xml" rel="alternate">
      <i class="fa fa-rss"></i>RSS
    </a>
  </div>





  <div class="links-of-author motion-element">
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/Hzrj" title="GitHub &rarr; https://github.com/Hzrj" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="mailto:1316836373@qq.com" title="E-Mail &rarr; mailto:1316836373@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-E-Mail"></i>E-Mail</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://blog.csdn.net/I_TenKai" title="csdn &rarr; https://blog.csdn.net/I_TenKai" rel="noopener" target="_blank"><i class="fa fa-fw fa-globe"></i>csdn</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://baidu.com" title="baidu &rarr; https://baidu.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-baidu"></i>baidu</a>
      </span>
    
  </div>







          
          
        </div>
      </div>

      
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="298" height="52" src="//music.163.com/outchain/player?type=2&id=33075054&auto=0&height=32"></iframe>		  
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="298" height="52" src="//music.163.com/outchain/player?type=2&id=1354221816&auto=0&height=32"></iframe>
      
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
	
  </aside>
  <div id="sidebar-dimmer"></div>
  


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Evian Z</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">站点总字数：</span>
    
    <span title="站点总字数">70k</span>
  

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    
    <span title="站点阅读时长">1:27</span>
  
  <a href="http://www.beian.gov.cn">粤ICP备44522202000153号</a> 
</div>
<!-- 

  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>

-->


  
  <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?51920f44b6f27592d202fbbbec94df40";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="post-meta-item-icon">
      <i class="fa fa-user"></i>
    </span>
    <span class="site-uv" title="总访客量">
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
    </span>
  

  
    <span class="post-meta-divider">|</span>
  

  
    <span class="post-meta-item-icon">
      <i class="fa fa-eye"></i>
    </span>
    <span class="site-pv" title="总访问量">
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
    </span>
  
</div>









        
      </div>
    </footer>

    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  













  <script src="/js/local-search.js?v=7.2.0"></script>












<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>



  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>






  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
